<?php 

	$OBJCTDC = $_GET['DID'];
	$MDDC = 'ED';
	?>
<DIV class="Line" id="DC_File">
	<?php
	$DC = $GLOBALS['MYT']->db_array("SELECT * FROM hd_documentos WHERE dtd_ID = {$OBJCTDC}");
	for ($dc = 1; $dc <= $DC[0]; $dc++) {
		$DC_CLIENTE = $DC[$dc]['dtd_Cliente'];
		mn_field('hidden','ED','dtd_ID',$DC[$dc]['dtd_ID'],'','','','');
		$FILE = $GLOBALS['DOC'].'PRFLDOCS/'.$DC_CLIENTE.'/'.$DC[$dc]['FILE'];

	if (file_exists($FILE) && $DC[$dc]['FILE'] != Null) {
	if ($DC[$dc]['DC_OFFICE'] == $_SESSION[$SESSOF]) {
		$MDDC = 'RD';
	}  ?>
<table width="100%"  border="0" cellspacing="3" cellpadding="1">
  <tr>
    <td><img width="400" src="_response/bin.php?IMG=<?php echo $DC[$dc]['FILE'];?>&RSIF=<?php echo $DC_CLIENTE;?>"></td>
    <td width="100%" valign="top">
	<?php echo mn_field('button','ED','Nav_ButtonDC','Fechar Pre-visualizacao','','','','" onclick="document.getElementById(\'DC_File\').innerHTML=\'\';');
	echo ' | ';
	mn_field('button','ED','DC_Open','Abrir Documento','','','','" onclick="
		modalwindow(\'Pre-visualizacao\',\'Modules/MX19F94S/docview.mex?ID='.$DC[$dc]['dtd_ID'].'&RSID='.$DC[$dc]['FILE'].'&RSIF='.$DC_CLIENTE.'\',905,500);');


		echo '<p>Substituir Comprovativo do Documento: ';
		mn_field('button','ED','Enviar ficheiros','Anexar ficheiro','','','False','inputbox"
		onClick="newwindow(\'_response/call.php?get=Operative/opv_senderdocumentattch&ID='.$OBJCTDC.'&CID='.$DC_CLIENTE.'\',\'Uploader\');'); ?>
	   </td>
  </tr>
</table>
	<?php } else {
		echo 'Comprovativo do Documento: ';
		mn_field('button','ED','Enviar ficheiros','Anexar ficheiro','','','False','inputbox"
		onClick="newwindow(\'_response/call.php?get=Operative/opv_senderdocumentattch&ID='.$OBJCTDC.'&CID='.$DC_CLIENTE.'\',\'Uploader\');');
	}
	}?>
</DIV>
